package org.dromara.exam.domain.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.apache.ibatis.type.JdbcType;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.exam.domain.dto.TemplateSchema;

import java.io.Serial;
import java.math.BigDecimal;

/**
 * 题目对象 exam_question
 *
 * @author xiyin321
 * @date 2024-04-11
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName(value = "exam_template", autoResultMap = true)
public class ExamTemplate extends BaseEntity {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 题目ID
     */
    @TableId(value = "template_id")
    private Long templateId;

    /**
     * 题库ID
     */
    private Long repoId;

    /**
     * 题目类型
     */
    private TemplateSchema.QuestionType questionType;

    /**
     * 显示顺序
     */
    private Long orderNum;

    /**
     * 题目标题
     */
    private String templateName;

    /**
     * 题目模板
     */
    @TableField(typeHandler = JacksonTypeHandler.class, jdbcType = JdbcType.LONGVARCHAR)
    private TemplateSchema template;

    /**
     * 标签
     */
    @TableField(typeHandler = JacksonTypeHandler.class, jdbcType = JdbcType.VARCHAR)
    private String[] tag;

    /**
     * 答案
     */
    private String answer;

    /**
     * 分值
     */
    private BigDecimal score;

    /**
     * 删除标志
     */
    @TableLogic
    private String delFlag;

    /**
     * 备注信息
     */
    private String remark;
}
